b440910b8814ce7174fec24a372a6312d18d4291,tests/junit/org/jgroups/tests/SequencerOrderTest.java,SequencerOrderTest,testBroadcastSequence,#,60
Before Change
public void testBroadcastSequence() throws Exception {
r1=new MyReceiver(ch1.getAddress());
ch1.setReceiver(r1);
r2=new MyReceiver(ch2.getAddress());
ch2.setReceiver(r2);
// use concurrent senders to send messages to the group
Thread thread1 = new Thread() {
public void run() {
Util.sleep(300);
for(int i=1; i <= NUM_MSGS; i++) {
try {
ch1.send(new Message(null, null, new Integer(i)));
} catch (Exception e) {
throw new RuntimeException(e);
}
System.out.print("-- messages sent thread 1: " + i + "/" + NUM_MSGS + "\r");
}
}
};
Thread thread2 = new Thread() {
public void run() {
Util.sleep(300);
for(int i=1; i <= NUM_MSGS; i++) {
try {
ch2.send(new Message(null, null, new Integer(i)));
} catch (Exception e) {
throw new RuntimeException(e);
}
System.out.print("-- messages sent thread 2: " + i + "/" + NUM_MSGS + "\r");
}
}
};
thread1.start();
thread2.start();
thread1.join();
thread2.join();
System.out.println("");
System.out.println("-- verifying messages on ch1 and ch2");
verifyNumberOfMessages(NUM_MSGS * 2);
verifyMessageOrder(r1.getMsgs());
verifyMessageOrder(r2.getMsgs());
verifySameOrder();
}
After Change
sender.join(20000);
final List<String> l1=r1.getMsgs();
final List<String> l2=r2.getMsgs();
System.out.println("-- verifying messages on A and B");
verifyNumberOfMessages(EXPECTED_MSGS, l1, l2);